#pragma once

#include "movingEntity.h"
#include "misc/vector2D.h"
#include "misc/smoother.h"

#include "statemachine.h"

#include <vector>
#include <list>
#include <string>

class Flocking;
class InGame;

class Vehicle : public MovingEntity
{

private:
  //disallow the copying of Vehicle types
  Vehicle(const Vehicle&);
  Vehicle& operator=(const Vehicle&);

  Flocking* m_pFlocking;

  //this vector represents the average of the vehicle's heading
  //vector smoothed over the last few frames
  Vector2D             m_vSmoothedHeading;

  //some steering behaviors give jerky looking movement. The
  //following members are used to smooth the vehicle's heading
  Smoother<Vector2D>*  m_pHeadingSmoother;

  //when true, smoothing is active
  bool                  m_bSmoothingOn;

  InGame* m_pWorld;


public:

	Vehicle(	InGame*	pWorld,
				double		rotation,
				Vector2D	velocity,
				double		max_force,
				double		max_speed,
				double		max_turn_rate,
				double		mass);

  ~Vehicle();

  // Virtual Initialize
  bool						Initialize();

  // Virtual Update Function
  void						Update(float fdT);

  // Draw Sprite
  void						Draw();


                                                                          
  //-------------------------------------------accessor methods
  Flocking*const  FlockingInstance()const{return m_pFlocking;}
  InGame*const    World()const{return m_pWorld;} 
  bool        isSmoothingOn()const{return m_bSmoothingOn;}
};